#!/bin/bash
# description:  Rsync war file
# version:	1.0
# author:
# contact:
#
. functions.sh

GENERIC_SRC=smx@${DL_SERVER}:/opt/www/ops30.sumilux.com

echo "--> Begin to download cwebtools file"

if [ ! -e /opt/cwebtools ]; then
mkdir -p /opt/cwebtools
fi

SOFILES_SRC=smx@${DL_SERVER}:/opt/www/${DL_SERVER}/cwebtools/
rsync ${RSYNC_OPTS} --exclude "input" --exclude "output" --exclude "logs" --exclude "pdftools/WEB-INF/classes/path.properties" --exclude "pdftools/WEB-INF/classes/log4j.properties" -e "${RSH_OPTS}" ${SOFILES_SRC} /opt/cwebtools/

chown -R tomcat:tomcat /opt/cwebtools

echo "--> Begin to download cwebtools fonts file"
if [ ! -e /usr/share/fonts ]; then
mkdir -p /usr/share/fonts
fi

FONTS_FILE_SRC=${GENERIC_SRC}/cwebtools/share/fonts/
FONTS_FILE_DST=/usr/share/fonts/
rsync ${RSYNC_OPTS} -e "${RSH_OPTS}" ${FONTS_FILE_SRC} ${FONTS_FILE_DST} 1>/dev/null